package game;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.JButton;
import javax.swing.JPanel;

public class ControlPanel extends JPanel {
	private GamePanel gamePanel;

	
	private Action stopAction = new AbstractAction("stop") {
		@Override
		public void actionPerformed(ActionEvent e) {
			gamePanel.stop();
		}
	};
	private JButton stopButton = new JButton(stopAction);
	
	private Action startAction = new AbstractAction("start") {
		@Override
		public void actionPerformed(ActionEvent e) {
			gamePanel.start();
		}
	};
	private JButton startButton = new JButton(startAction);
	
	private Action resetAction = new AbstractAction("reset") {
		@Override
		public void actionPerformed(ActionEvent e) {
			gamePanel.reset();
		}
	};
	private JButton resetButton = new JButton(resetAction);
	
	
	public ControlPanel(GamePanel gamePanel) {
		this.gamePanel = gamePanel;
		
		add(startButton);
		add(stopButton);
		add(resetButton);
	}
}
